
package me.zhengjie.modules.workOrder.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;

import me.zhengjie.base.BaseEntity;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author 李奎
* @date 2023-06-29
**/
@Entity
@Data
@SuppressWarnings("all")
@Table(name="wk_work_order_head")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
public class WorkOrderHead extends BaseEntity implements Serializable {

    @Id
    @Column(name = "`work_id`",length = 32)
    @ApiModelProperty(value = "工单主键id")
    @GeneratedValue(generator = "jpa-uuid")
    private String workId;

    @Column(name = "`work_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "工单名称")
    private String workName;

    @Column(name = "`work_describle`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "工单描述")
    private String workDescrible;

    @Column(name = "`work_code`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "工单编号")
    private String workCode;

    @Column(name = "`project_id`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "所属项目id")
    private String projectId;

    @Column(name = "`project_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "所属项目名称")
    private String projectName;

    @Column(name = "`order_number`")
    @ApiModelProperty(value = "排序")
    private Integer orderNumber;

    @Column(name = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "`is_delete`")
    @ApiModelProperty(value = "删除标识（0：删除，1：未删除）")
    private String isDelete;

    @Column(name = "`create_by`")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @Column(name = "`update_by`")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @Column(name = "`create_time`")
    @CreationTimestamp
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "`update_time`")
    @UpdateTimestamp
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    public void copy(WorkOrderHead source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
